package com.twu.biblioteca;

import java.util.Date;

public class Customer {

    private String name;
    private Date dateOfBirth, dateOfMembership;
    private String address;
    private long contact;
    private String email;
    private String libraryNo;
    private String password;


    public Customer() {
    }
    public Customer(String name, Date dateOfBirth, Date dateOfMembership, String address, long contact, String email, String libraryNo, String password) {
        this.name = name;
        this.dateOfBirth = dateOfBirth;
        this.dateOfMembership = dateOfMembership;
        this.address = address;
        this.contact = contact;
        this.email = email;
        this.libraryNo = libraryNo;
        this.password = password;
    }


    public void reserveBook(Book b) {

        long numberOfCopies;
        if (b.getNumberOfCopies() > 0) {
            System.out.println("Thank you enjoy the book!!");
            numberOfCopies = b.getNumberOfCopies() - 1;
            b.setNumberOfCopies(numberOfCopies);
        } else
            System.out.println("Book not available yet!!");
    }


    public void membershipDetails() {
        if (BibliotecaApp.loginStatus==false)
            System.out.println("Please,contact to your librarian ,Thank you !!");
        else
        {
            System.out.println("**Your Details**");
            System.out.println("Name: "+email);
            System.out.println("Address: "+address);
            System.out.println("Contact No: "+contact);
            System.out.println("Email Id: "+email);
        }

    }

    public String getPassword() {
        return password;
    }

    public String getLibraryNo() {
        return libraryNo;
    }
}
